var windowName = "fileMoneyLog";
var Page
var files = new List()

apiready = function(){
    var CarPics = new PicUp()
    onWindowShow(function () {
        var cur = getLocData("curFile")
        Page.curFile = cur;
        getData(Page);
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");

    Page = createVM("#Page",{
        //页面数据
        tab:0,
        curFile:{},
        sites:[],
        list:[],
        listPic:[],
        pics:[],
        en:{
            "id": "",
            "fileId": "",
            "file": "",
            "fileName": ""
        },
        atta:[],//展示层图片
        open:false,//展示层是否打开
    },{
        //页面方法
        "init":function () {
            var cur = getLocData("curFile")
            Page.curFile = cur;
            // getData(this);
        },
        setMoney:function (step) {
            var _this = this;
            apiGet("/app/file/money/set",{file:_this.curFile.id,step:step},function (res) {
                getData(_this)
            })
        }
    })
    Page.init()

}

function getData(_this) {
    apiGet("/app/file/money/get",{file:_this.curFile.id},function (res) {
        logJson(res)
        _this.en = res.data
    })
}